package com.mt.vsphere.core.util;


import com.mt.vsphere.core.bean.ConfFieldType;

public class ConfUtil {
    public static Object changeValueType(ConfFieldType filedType, String value, Class<?> cla){
        switch (filedType){
            case INT:
                return Integer.parseInt(value);
            case FLOAT:
                return Float.parseFloat(value);
            case LONG:
                return Long.parseLong(value);
            case Boolean:
                return Boolean.parseBoolean(value);
            case JsonBean:
                return JsonUtil.getObjByJsonString(value,cla);
            case JsonList:
                return JsonUtil.getListByJsonString(value,cla);
            default:
                return value;
        }
    }
}
